<template>
  <button
    ref="_ref"
    class="ct-button"
    :class="{
      [`ct-button--${type}`]: type,
      'is-plain': plain,
      'is-round': round,
      'is-disabled': disabled || loading,
      [`ct-button--${size}`]: size,
      'is-circle': circle,
    }"
    :disabled="disabled || loading"
  >
    <ct-icon v-if="loading" icon="spinner" spin />
    <ct-icon v-if="icon" :icon="icon" />
    <span v-if="$slots.default">
      <slot />
    </span>
  </button>
</template>
<script setup>
import { ref } from 'vue'
import propsOptions from './props'
defineOptions({
  name: 'CtButton',
})

defineProps(propsOptions)

const _ref = ref(null)

defineExpose({
  ref: _ref,
})
</script>
<style lang="less" scoped></style>
